package com.y.mytest.lang;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @ClassName: shuzu
 * @author: 叶子豪
 * @create: 2021-05-19 14:23
 */
public class shuzu {

    public static void main(String[] args) {
        System.out.println();
    }

    public void qiege() {
        byte[] bytes = new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};

        final int fileSize = bytes.length;
        int bufferSize = 3;

        int startPosition = 0; //子文件开始位置
        int endPosition = bufferSize;//子文件结束位置

        int fileCount = fileSize % bufferSize == 0 ? fileSize / bufferSize : fileSize / bufferSize + 1;


        for (int i = 0; i < fileCount; i++) {

            if (i + 1 == fileCount) {
                endPosition = fileSize;
            }
            byte[] copy = Arrays.copyOfRange(bytes, startPosition, endPosition);
            System.out.println(Arrays.toString(copy));

            startPosition = endPosition;
            endPosition = endPosition + bufferSize;
        }
    }

    public static void luckyNumbers(int[][] matrix) {


    }
}
